package com.rongxun.hbwallet.ui.ItemDecoration;

import android.content.Context;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * 创建者     庄丰泽
 * 创建时间   2018/5/28 18:07
 * 描述
 */

public class MnemonicDecoration extends RecyclerView.ItemDecoration {
    private Context mContext;
    private int     bottom;

    public MnemonicDecoration(Context context, int bottom) {
        mContext = context;
        this.bottom = bottom;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        if (parent.getChildAdapterPosition(view)<= 7) {
            //这里直接硬编码为1px
            outRect.bottom = bottom;
        }
    }
}
